import React from "react"
import {NavLink} from "react-router-dom";
import "./myNav.css"
const selectdStyle = {
    backgroundColor:"white",
    color:"pink"
}
export default class MyNav  extends React.Component{
    isTrue=(match,location)=>{
        return location.pathname === "/" || location.pathname === "/Main/Home"
    }
    render() {
        return(
            <div className="main-menu">
                {/*<NavLink isActive={this.isTrue} activeStyle={selectdStyle}  to="/Main/Home">首页</NavLink>*/}
                <NavLink activeStyle={selectdStyle}  to="/Main/Home">首页</NavLink>
                <NavLink activeStyle={selectdStyle} to="/Main/About">关于我们</NavLink>
                <NavLink activeStyle={selectdStyle}  to="/Main/Events">企业事件</NavLink>
                <NavLink activeStyle={selectdStyle}  to="/Main/Products">公司产品</NavLink>
                <NavLink activeStyle={selectdStyle}  to="/Main/Contact">联系我们</NavLink>
            </div>
        )
    }
}